#include <bits/stdc++.h>
using namespace std;
#define int long long

int n, dp[2003][2003], m;
char s[100005], t[100005];

int dfs(int i, int mt) {
	if (i == n + 1) return mt == m + 1;
	if (dp[i][mt] != -1) return dp[i][mt];
	int ans = 0;
	for (int j = i + 1; j <= n + 1; ++j) {
		if (j != i + 1 && (s[j - 1] != s[i + 1])) break;
		if (s[j] == t[mt]) {
			ans |= dfs(j, mt + 1);
			if (ans) break;
		}
	}
	return dp[i][mt] = ans;
}

signed main() {
	freopen("sequence.in", "r", stdin); freopen("sequence.out", "w", stdout);
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> (s + 1) >> (t + 1); n = strlen(s + 1); m = strlen(t + 1);
	memset(dp, 255, sizeof(dp));
	if (dfs(0, 1)) {
		cout << "YES\n";
		int i = 0, mt = 1;
		while (i != n + 1) {
			for (int j = i + 1; j <= n + 1; ++j) {
				if (j != i + 1 && (s[j - 1] != s[i + 1] )) break;
				if (j == n + 1 || s[j] == t[mt]) {
					if (dfs(j, mt + 1)) {
						i = j; ++mt;
						if (j != n + 1) cout << j << " " << flush;
						goto cont;
					}
				}
			}
			assert(0);
			cont : ;
		}
	} else {
		cout << "NO\n";
	}
	return 0;
}
